package com.topisv.tms.utils.http;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.topisv.tms.service.work.WorkOrderService;
import com.topisv.tms.utils.vo.WMSPrinter;
@Component
public class SynchroWMSPrintre implements Runnable {
	private static final Logger log = LoggerFactory.getLogger(SynchroWMSPrintre.class);
	
	@Autowired
	private WorkOrderService workOrderService;
	
	private boolean fa=true;
	@Override
	public void run() {
		// TODO Auto-generated method stub

		while(fa){
			try {
				WMSPrinter wMSPrinter = SynchroShippedBatchQueue.takeWmsPrinterQueue();
				log.info(wMSPrinter.toString());
				workOrderService.setPrintStatus(wMSPrinter.getOrdeno(), wMSPrinter.getExpressNo(), wMSPrinter.getCompanyCode(),wMSPrinter.getCurUser());
			} catch (Exception e) {
				log.error("error",e);
				
			}
		}
	}
	public void setFa(boolean fa) {
		this.fa = fa;
	}

}
